package com.example.goodsass.controller;

import com.example.goodsass.domain.Tgoods;
import com.example.goodsass.service.TgoodsService;
import com.example.goodsass.vo.goodsVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController()
@RequestMapping("/TGoods")
@Tag(name = "goods info",description = "商品信息")
public class TGoodsController {
    @Autowired
    private TgoodsService tgoodsService;

    @Operation(description = "GoodsSel")
    @GetMapping("GoodsSel")
    public String GoodsSel() {

        return null;
    }

    @Operation(description = "GoodsSelByNo")
    @GetMapping("GoodsSelNo")
    public goodsVO GoodsSelByNo(Integer No) {
        return tgoodsService.getGoodsByNo(No);
    }

    @Operation(description = "selGoodsInfo")
    @GetMapping("selGoodsInfo")
    public goodsVO selGoodsInfo() {
        return tgoodsService.selGoodsInfo();
    }

    @Operation(description = "delGoodsInfo")
    @GetMapping("delGoodsInfo")
    public String delGoodsInfo(int Goods_No) {
        return tgoodsService.delGoodsInfo(Goods_No);
    }

    @Operation(description = "insGoodsInfo")
    @PostMapping("insGoodsInfo")
    public String insGoodsInfo(@RequestBody Tgoods tgoods) {
        return tgoodsService.insGoodsInfo(tgoods);
    }

    @Operation(description = "updGoodsInfo")
    @PostMapping("updGoodsInfo")
    public String updGoodsInfo(@RequestBody Tgoods tgoods) {
        return tgoodsService.updGoodsInfo(tgoods);
    }
}
